package com.kuangsheng.test;

public class test {

    public static void main(String[] args) {

    }

    //长度判断
    public String getSecurityLevel (String password) {
        getGrand(password);
        return "ss";
    }

    //长度判断
    public Integer getGrand(String password){
        Integer grand = 0;
        if(password.length() <= 4){
            grand += 5;
        }else if(4< password.length() && password.length() <=7){
            grand += 10;
        }else if(8 <= password.length()){
            grand += 25;
        }
        //字母判断
        for(int i=0;i < password.length();i ++){
            char c = password.charAt(i);
            if (Character.isLowerCase(c)){
                    return grand +=10;
            }
            if (!Character.isUpperCase(c)){
                return grand +=10;
            }
        }
        int m = 0;
        //数字判断
        for(int i=0;i < password.length();i ++){
            char c = password.charAt(i);
            if (Character.isDigit(c)){
                m ++;
            }
            while (i == password.length() -1){
                if (m >1){
                    return grand+= 25;
                }
                if (m == 1){
                    return  grand+=10;
                }else {
                    return grand += 0;
                }
            }
        }

        return grand;
    }
}
